home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 1812 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.msn.com!news.compuserve.com
  2. From: ewl@panix.com (Emery Lapinski)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Help, best way to compare doubles
  5. Date: 16 Jan 1996 18:10:17 -0800
  6. Organization: Emery Lapinski, private citizen.
  7. Message-ID: <4dhlq9$82e@panix2.panix.com>
  8. References: <4da169$mm4@mercury.IntNet.net> <4dgnn5$em@news.microsoft.com>
  9. NNTP-Posting-Host: panix2.panix.com
  10. X-Forged-Path: I do not want my posts going to compuserve or msn
  11. X-SpookFood: [Hello to all my fans in domestic surveillance] arrangements colonel counter-intelligence terrorist
  12. X-ClamFood: OT VI OT VII KISSER NED FOR OTs COATES ScamIzDat
  13. X-CanterAndSiegel: Green Cards? Oxygenated Water? Hatred and disgust!
  14. X-Homepage: http://www.panix.com/~ewl/
  15.  
  16. In article <4dgnn5$em@news.microsoft.com>,
  17. Dann Corbit <a-cnadc@microsoft.com> wrote:
  18. >In article <4da169$mm4@mercury.IntNet.net>, jtomich@IntNet.net says...
  19. >>
  20. >>Looking for a way to compare doubles for equality.
  21. >>
  22. >A very dangerous practice, as computing the same result two different 
  23. >ways may not have exactly the same result.  Sometimes a test such as:
  24. >  abs( double1 - double2 ) < dEpsilon 
  25. >is used, but this technique is not always valid.  Suppose, for instance,
  26.  
  27. You bet it's not always valid; abs() takes and returns an int.
  28. -- 
  29. ewl@panix.com | http://www.panix.com/~ewl | "You can have my useless cat(1) 
  30. when you pry it from my cold dead finger(1)." | This work is Copyright 1995 
  31. Emery Lapinski and is freely redistributable by anyone and anything with the 
  32. exception of Microsoft Network. | Telco Bill, make a run for strong encryption.
  33.